var util = require("util");
var EventEmitter = require("events").EventEmitter;

function MyEvent(){
	//EventEmitter.call(this);
}

util.inherits(MyEvent, EventEmitter);

MyEvent.prototype.out = function(){
	console.log("this is MyEvent class out method");
}


var myEvent = new MyEvent();

myEvent.out();

myEvent.on("event1", function(){
	console.log("event1 被触发");
});

myEvent.emit("event1");

